<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户增加页面</title>
<link rel="stylesheet" type="text/css" href="../../Res/LayUI/css/layui.css" media="all">
<script type="text/javascript" src="../../Res/JS/jquery-1.10.2.js"></script>
<script src="../../Res/JS/common.js"></script>
  
<style type="text/css">
	body{  
		margin:20px 0px;
	}
</style>
</head>
<body>
	<fieldset class="layui-elem-field layui-field-title"
		style="margin-top: 20px;">
		<legend>增加用户</legend>
	</fieldset>

	<form class="layui-form" action="../../ManagerAction/addManaRole" method="post">
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">用户名</label>
				<div class="layui-input-inline">
					<input type="text" name="manUser" id="manUser" 
						lay-verify="" placeholder="请输入用户名" maxlength="18"
						autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">密码</label>
				<div class="layui-input-inline">
					<input type="text" name="manPwd" id="manPwd" 
						lay-verify="" placeholder="请输入用户密码" autocomplete="off"
						class="layui-input" maxlength="18">
				</div>
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">用户电话号码</label>
				<div class="layui-input-inline">
					<input type="text" name="manPhone" id="manPhone" 
						lay-verify="" placeholder="请输入用户电话号码" maxlength="18"
						autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">用户角色</label>
				<div class="layui-input-inline">
					<select class="input-xlarge" name="roleId" id="roleId">
						
					</select>
				</div>
			</div>
		</div>
		
			
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">用户备注</label>
				
				<div class="layui-input-inline">
					<textarea rows="4" cols="25" lay-verify="" autocomplete="off" name="manRemark" id="manRemark" placeholder="请输入备注" maxlength="18"></textarea>

				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">是否有效</label>
				<div class="layui-input-inline">
					<select class="input-xlarge" name="isva" id="isva">
						<option value="2">有效</option>
					    <option value="1">无效</option>
					</select>
				</div>
			</div>
			
			
			<div class="layui-inline">
				<label class="layui-form-label">操作人</label>
				<div class="layui-input-inline">
					<input type="text" name="oper" id="oper" 
						lay-verify="" placeholder="请输入操作人" autocomplete="off"
						class="layui-input" maxlength="18">
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-block">
				<input type="submit" id="submit" class="layui-btn" lay-submit="Add"
					lay-filter="Add" value="立即增加">
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div> 
		</div>
	</form>
	<script src="../../Res/LayUI/layui.js" charset="utf-8"></script>
	<script type="text/javascript">
		$(function(){
			url=getRootPath()+"ManagerAction/findRole";
			$.ajax({
				async:false,
				Type:"POST",
				dataType:"JSON",				
				url:url,
				success:function(msg){
					var str="";
					for(var i=0; i<msg.length; i++){
						str+="<option value='"+msg[i].roleId+"'>"+msg[i].roleName+"</option>";
					}
					$("#roleId").html(str);
					layui.use(['form','tree'], function(){
						var form = layui.form
						,layer = layui.layer
						,$ = layui.$;
						  
						form.on('submit(Add)',function(){
					   		parent.location.reload(); // 父页面刷新
						});
					});
				},
				error:function(msg){
					alert("失败");
				}  
			});
			
			
			
		});
	</script>
</body>
</html>